﻿using System;
using System.Collections.Generic;
using System.Text;

namespace QLNHK.BLL
{
    public abstract class Ent_Base : System.ComponentModel.INotifyPropertyChanged, System.ComponentModel.IDataErrorInfo
    {
        protected Ent_Base() { }

        protected string m_Error = string.Empty;
        protected System.Collections.Hashtable m_PropErrors = new System.Collections.Hashtable();

        string System.ComponentModel.IDataErrorInfo.Error
        {
            get
            {
                return m_Error;
            }
        }

        string System.ComponentModel.IDataErrorInfo.this[string columnName]
        {
            get
            {
                return (string)m_PropErrors[columnName];
            }
        }
        
        /// <summary>
        /// Sự kiện khi thuộc tính của đối tượng thay đổi
        /// </summary>
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        #region OnPropertyChanged
        /// <summary>
        /// Triggers the PropertyChanged event.
        /// </summary>
        protected virtual void OnPropertyChanged(string PropertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(null, new System.ComponentModel.PropertyChangedEventArgs(PropertyName));
        }
        #endregion
    }
}
